﻿using System.Drawing.Imaging;
using Spire.Pdf;

Console.WriteLine("Start");

var doc = new PdfDocument();
doc.LoadFromFile("test.pdf");
using var stream = File.Open($"output{DateTime.Now:yyMMddHHmmss}.jpg", FileMode.Create);
using var img = doc.SaveAsImage(1, Spire.Pdf.Graphics.PdfImageType.Bitmap, 300, 300);
img.Save(stream, ImageFormat.Jpeg);

Console.Read();